﻿using JustMetClient.Models.NoticeModels;
using Azylee.Core.IOUtils.TxtUtils;
using Azylee.Core.Plus.DataUtils.JsonUtils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace JustMetClient.Views.NoticeViews
{
    public partial class NoticeForm : Form
    {
        NoticeModel Notice { get; set; }
        public NoticeForm(NoticeModel model)
        {
            InitializeComponent();
            Notice = model;
        }

        private void NoticeForm_Load(object sender, EventArgs e)
        {
            var def = new NoticeModel()
            {
                Title = LBTitle.Text,
                Content = RTBContent.Text,
                Promulgator = LBPromulgator.Text,
                SendTime = DateTime.Now,
            };

            if (Notice != null)
            {
                LBTitle.Text = Notice.Title;
                RTBContent.Text = Notice.Content;
                LBPromulgator.Text = Notice.Promulgator;
                LBSendTime.Text = Notice.SendTime.ToString("yyyy年M月d日");
            }
        }
    }
}
